import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    children:[
      {
        path: '/sys-admin/product/album/add-new',
        component: () => import('../views/sys-admin/product/AlbumAddNewView')
      },
      {
        path: '/sys-admin/product/album',
        component: () => import('../views/sys-admin/product/AlbumListView')
      },
      {
        path: '/sys-admin/product/category',
        component: () => import('../views/sys-admin/product/CategoryListView')
      },
      {
        path: '/sys-admin/product/category/add-new',
        component: () => import('../views/sys-admin/product/CategoryAddNewView')
      },
      {
        path: '/sys-admin/product/AttributeTemplate',
        component: () => import('../views/sys-admin/product/AttributeTemplateListView')
      },
      {
        path: '/sys-admin/product/attribute-template/add-new',
        component: () => import('../views/sys-admin/product/AttributeTemplateAddNewView')
      },
      {
        path: '/sys-admin/product/spu-management',
        component: () => import('../views/sys-admin/product/SpuManagement.vue')
      },
      {
        path: '/sys-admin/product/spu-management/sku-list',
        component: () => import('../views/sys-admin/product/SkuListView.vue')
      },
      {
        path: '/sys-admin/product/spu/add-new-1',
        component: () => import('../views/sys-admin/product/SpuAddNewView1')
      },
      {
        path: '/sys-admin/product/spu/add-new-2',
        component: () => import('../views/sys-admin/product/SpuAddNewView2.vue')
      },
      {
        path: '/sys-admin/product/spu/add-new-3',
        component: () => import('../views/sys-admin/product/SpuAddNewView3.vue')
      },
      {
        path: '/sys-admin/product/spu/add-new-4',
        component: () => import('../views/sys-admin/product/SpuAddNewView4.vue')
      },
      {
        path: '/sys-admin/product/albums/picture-list',
        component: () => import('../views/sys-admin/product/AlbumPictureListView.vue')
      },
      {
        path: '/sys-admin/product/attribute',
        component: () => import('../views/sys-admin/product/AttributeListView.vue')
      },
      {
        path: '/sys-admin/product/attribute/add-new',
        component: () => import('../views/sys-admin/product/AttributeAddNewView.vue')
      },

// ======================== 权限管理 ========================
      {
        path: '/sys-admin/permission/admin/add-new',
        component: () => import('../views/sys-admin/permission/AdminAddNewView')
      },
      {
        path: '/sys-admin/permission/admin',
        component: () => import('../views/sys-admin/permission/AdminListView')
      },
    ]
  },
  {
    path: '/about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/login',
    component: () => import('../views/LoginView.vue')
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
